
//引用转发包
const rp = require('request-promise')
const initOption = {
    headers: {
        authorization: ""
    },
    json: true // Automatically stringifies the body to JSON
}
module.exports = {//暴露一个方法 ，接收token
    setToken: token => (initOption.headers['authorization'] = token),
    async request(option) {
        return await rp({
            ...initOption,
            ...option//整合
        })
    }
}